home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
WD_SRC.ZIP
/
BSP_GEN
/
IO.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-29
|
2KB
|
96 lines
class MFile;
// Command line processing.
//////////////////////////////////////
typedef struct
{
BOOL bDoomLevel;
char *pLevelName;
char *pTextureWadName;
BOOL bLoadDoomTextures;
char *pFilename;
WORD balance;
char *pOutputFile;
BOOL bGraphicalDisplay;
} BspCommandLine;
BOOL ProcessCommandLine( int argc, char *argv[], BspCommandLine *pToProcess );
// Text file IO.
//////////////////////////////////////
BOOL LoadTextData( BYTE *pFilename, CLineArray *pLines, CPointArray *pPoints );
BOOL LoadBinaryData( BYTE *pFilename, CLineArray *pLines, CPointArray *pPoints );
BOOL OutputTextData( CLine *pRoot, char *pFilename, CLineArray *pLines, CPointArray *pPoints );
BOOL OutputBinaryData( CLine *pRoot, char *pFilename, CLineArray *pLines, CPointArray *pPoints );
void NodeInfo( CLineArray *pLineList, WORD *pNInternal, WORD *pNExternal );
void SkipComments(FILE *fp);
// Graphical display.
//////////////////////////////////////
BOOL DisplayGraphicalData( CLineArray *pLines, CPointArray *pPoints );
void DrawLine( DWORD x1, DWORD y1, DWORD x2, DWORD y2 );
// Doom level reading.
//////////////////////////////////////
typedef struct
{
DWORD resPos;
DWORD resLength;
BYTE resName[8];
} DirEntry;
typedef struct
{
WORD x;
WORD y;
} DoomVertex;
typedef struct
{
WORD iFromVert;
WORD iToVert;
WORD attributes;
WORD type;
WORD tag;
WORD rightSidedef;
WORD leftSidedef;
} DoomLinedef;
typedef struct
{
WORD xOffset;
WORD yOffset;
BYTE upperTex[8];
BYTE lowerTex[8];
BYTE normalTex[8];
WORD sectorRef;
} DoomSidedef;
BOOL LoadDoomLevel( BYTE *pFilename, BYTE *pLevelName, CLineArray *pLineArray, CPointArray *pPointArray, BOOL bLoadTextures, BYTE *pTextureWadName );
DWORD GetDirEntry( MFile *fpWadFile, char *pEntryName, DWORD startSearchAt, DirEntry *pEntry );